let modules = 'admin/modules';
let node_modules = "node_modules";

requirejs.config({
    //urlArgs: "bust=5",
    shim: {
        ace: {
            deps: ['jquery', 'bootstrap']
        },
        bootstrap: {
            deps: ['jquery']
        },
        dilu: {
            exports: "maishu-dilu"
        },
        application: {
            deps: ['chitu']
        },
        'jquery-ui': {
            exports: 'window["$"]',
            deps: [
                'jquery',
                'css!lib/jquery-ui-1.10.0.custom'
            ]
        },
        mobileControls: {
            exports: 'controls',
            deps: ['hammer', 'bezier-easing']
        },
        ui: {
            exports: 'ui'
        },
        um: {
            deps: [
                'jquery',
                'css!../lib/umeditor/themes/default/css/umeditor.css',
                // '../lib/umeditor/third-party/template.min',
                'um_config',
            ]
        },
        um_zh: {
            deps: ['um']
        },
        qrcode: {
            exports: 'QRCode'
        },
        wuzhui: {
            deps: ['jquery']
        }
    },
    baseUrl: '../',
    paths: {

        css: 'lib/css',
        less: 'lib/require-less-0.1.5/less',
        lessc: 'lib/require-less-0.1.5/lessc',
        normalize: 'lib/require-less-0.1.5/normalize',
        text: 'lib/text',


        ace_editor: 'lib/ace-builds/src',
        'art-template': 'lib/template-web',
        bootstrap: 'lib/bootstrap',

        clipboard: 'lib/clipboard.min',
        dilu: 'lib/dilu',
        formValidator: 'lib/formValidator',
        hammer: 'lib/hammer',
        iscroll: 'lib/iscroll-lite',
        jquery: 'lib/jquery-2.1.3',
        react: 'lib/react.development',
        mobileControls: 'lib/mobileControls',
        move: 'lib/move',

        polyfill: 'lib/polyfill',
        polished: 'lib/polished',

        ui: 'lib/ui',
        um: 'lib/umeditor/umeditor',
        um_config: 'lib/umeditor/umeditor.config',
        um_zh: 'lib/umeditor/lang/zh-cn/zh-cn',

        knockout: 'lib/knockout-3.2.0.debug',
        'knockout.validation': 'lib/knockout.validation',

        'bezier-easing': 'lib/bezier-easing',
        'jquery.fileupload': 'lib/jQuery.FileUpload/jquery.fileupload',
        'jquery.validate': 'lib/jquery.validate',
        'jquery-ui': 'lib/jquery-ui',//'https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min',//
        'jquery.ui.widget': 'lib/jquery.ui.widget',
        'js-xlsx': 'lib/js-xlsx/xlsx.full.min',
        'js-md5': `${node_modules}/js-md5/src/md5`,
        'qrcode': 'lib/qrcode',
        'react-dom': 'lib/react-dom.development',
        'prop-types': 'lib/prop-types',

        'chitu': '../node_modules/maishu-chitu/out/index',
        'chitu.mobile': 'lib/chitu.mobile',
        'wuzhui': 'lib/wuzhui',

        "maishu-wuzhui": `${node_modules}/maishu-wuzhui/dist/index`,
        'maishu-chitu': `${node_modules}/maishu-chitu/dist/index`,
        "maishu-chitu-react": `${node_modules}/maishu-chitu-react/dist/index`,
        "maishu-dilu": `${node_modules}/maishu-dilu/dist/index`,
        "maishu-wuzhui-helper": `${node_modules}/maishu-wuzhui-helper/dist/index`,
        "maishu-chitu-service": `${node_modules}/maishu-chitu-service/dist/index`,
        "maishu-ui-toolkit": `${node_modules}/maishu-ui-toolkit/dist/index`,
        "maishu-services-sdk": `${node_modules}/maishu-services-sdk/dist/index`,
        "maishu-haoyi-shop": `${node_modules}/maishu-haoyi-shop/`,

        ace: 'assets/js/uncompressed/ace',

        'ue': 'lib/ueditor',//'http://web.bailunmei.com/ueditor',//
        adminServices: 'admin/services',
        'masterPage': 'admin/masterPage',
        modules: 'admin/modules',
        content: 'admin/content',
        'ue.ext': 'admin/ue.ext',
        myWuZhui: 'admin/myWuZhui',
        'socket.io': 'http://shopws.bailunmei.com/socket.io/socket.io',

        //=============================================================
        // 页面路径
        // 'modules/station/store/home': `${modules}/station/storePageDesign`,
        // 'modules/station/store/member': `${modules}/station/storePageDesign`,
        // 'modules/station/store/menu': `${modules}/station/storePageDesign`,
        // 'modules/station/store/coupon': `${modules}/station/storePageDesign`,

        //=============================================================
    }
});

// requirejs(['../node_modules/maishu-chitu/out/chitu'],function(){
//     debugger
// })

requirejs(['admin/build', 'admin/weixin/build', "maishu-chitu"], function (a, b, c) {
    window["chitu"] = c;
    define("chitu", function () {
        return c;
    })
    requirejs(['less!admin/content/admin_style_default'])
    var references = ['react', 'react-dom', 'admin/application', 'qrcode', 'clipboard', 'art-template', 'bootstrap'];
    requirejs(references, function (React, ReactDOM, app, qrcode, clipboard) {
        window['React'] = React;
        window['ReactDOM'] = ReactDOM;
        window['h'] = React.createElement;
        window['QRCode'] = qrcode || window['QRCode'];
        window['ClipboardJS'] = clipboard || window['ClipboardJS']
        app.default.run();

    });
})

// define('modules/station/store/home', [`${modules}/station/storePageDesign`], function (mod) {
//     return mod
// })
// define('modules/station/store/member', [`${modules}/station/storePageDesign`], function (mod) {
//     return mod
// })
// define('modules/station/store/menu', [`${modules}/station/storePageDesign`], function (mod) {
//     return mod
// })
// define('modules/station/store/coupon', [`${modules}/station/storePageDesign`], function (mod) {
//     return mod
// })
// define('modules/station/store/shoppingCart', [`${modules}/station/storePageDesign`], function (mod) {
//     return mod
// })
// define('modules/station/store/categories', [`${modules}/station/storePageDesign`], function (mod) {
//     return mod
// })
// define('modules/station/store/style', [`${modules}/station/storeStyle`], function (mod) {
//     return mod
// })
// define('modules/shopping/product/productEdit', [`${modules}/shopping/product/newProductEdit`], function (mod) {
//     return mod
// })
// define('modules/station/productTemplates', [`${modules}/shopping/product/productTemplates`], function (mod) {
//     return mod
// })
// define('modules/station/productTemplate', [`${modules}/shopping/product/productTemplate`], function (mod) {
//     return mod
// })




